﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using System.Xml;
using System.IO;

namespace DLL.Entities
{
    class XMLHandler
    {
       
        public static bool WriteXML(object savedObj, string fileToSave, XmlSerializer serializer)
        { 
          try
             { 
                TextWriter textWriter = new StreamWriter(fileToSave);
                serializer.Serialize(textWriter, savedObj); 
                textWriter.Close();
              return true;
          } 
          catch (Exception ex)
          { 
              Utility.LogFile(ex.ToString()); return false;
          }
        }
    }
}
